#define _CRT_SECURE_NO_WARNINGS
#include"string.h"
namespace mutou
{
	void test01()
	{
		string s1;
		string s2("sadadad");
		string s3 = "sadadadadadad";
		std::cout << s2.c_str() << std::endl;
		std::cout << s3.c_str() << std::endl;

	}
	void test02()
	{

		string s1("hello world!");
		for (int i = 0; i < s1.size(); i++)
		{

			std::cout << s1[i] << " ";
		}
		std::cout << std::endl;
		string::iterator it = s1.begin();
		while (it != s1.end())
		{
			std::cout << *it << " ";
			it++;

		}
		std::cout << std::endl;
		for (auto ch : s1)
		{
			std::cout << ch << " ";

		}

	}
	void test03()
	{

		string s1 = "hello world";
		std::cout << s1.c_str() << std::endl;

		s1.push_back('x');
		std::cout << s1.c_str() << std::endl;

		s1.append("xxxxx");
		std::cout << s1.c_str() << std::endl;

		s1 += '1';
		std::cout << s1.c_str() << std::endl;
		s1 += "dadadad";
		std::cout << s1.c_str() << std::endl;

	}
	void test04()
	{

		string s1 = "hello world";
		s1.resize(20, 's');
		std::cout << s1.c_str() << std::endl;

	}
	void test05()
	{
		string s1 = "hello world";
		string s2 = "hello";
		std::cout << (s2 < s1) << std::endl;

	}
	void test06()
	{
		string s5;
		string  s3 = "https://gitee.com/woodcola";
		size_t pos = s3.find(':');
		if (pos != string::npos)
		{
			  s5 = s3.substr(0, pos);
			std::cout << s5.c_str() << std::endl;
		}
		size_t pos1 = s3.find('/', pos + 3);
		if (pos1 != string::npos)
		{
			s5 = s3.substr(pos + 3, pos1 - pos - 3);
			std::cout << s5.c_str() << std::endl;
		}
		s5 = s3.substr(pos1);
		std::cout << s5 << std::endl;
		
	}
	void test07()
{
	string s1 = "hello world";
	string s2 = "hellow";
	s1.insert(5, 'x');
	s2.insert(0, '1');
	s2.insert(3, "%%%%%");
	
	std::cout << s1.c_str() << std::endl;
	std::cout << s2.c_str() << std::endl;
	s2.erase(3, 5);
	std::cout << s2.c_str() << std::endl;
}
	void test08()
	{
		string s1;
		std::cin >> s1;
		std::cout << s1.c_str() << std::endl;
	}
	void test09()
	{
		string s1 = "hello";
		string s2 = "world ";
		s1.swap(s2);

	}
	void test10()
	{
		string s1 ("11111");
		string s2(s1);
		string s3 = "dadadada";
		s3 = s2;
		std::cout << s1 << std::endl;
		std::cout << s2 << std::endl;
		std::cout << s3 << std::endl;
	}
}

int main()
{

	mutou::test10();
	return  0;



}